<template>
  <h1>志龙的天下</h1>
  <!-- <button @click="$router.push('/register')">跳转到注册</button> -->
  <!-- <button @click="$router.push({ name: 'register' })">跳转到注册</button> -->
  <button @click="goRegister">跳转到注册</button>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { useRoute, useRouter } from "vue-router";

export default defineComponent({
  setup() {
    const route = useRoute();
    console.log(route);
    console.log(route.params.id);
    const router = useRouter();

    const goRegister = () => {
      router.push({ name: "register" });
    };
    return {
      goRegister,
    };
  },
});
</script>

<style scoped>
</style>